import request from 'utils/request'

class userService {

    /**
     * 手机号验证码登录接口
     * @param {*} params 
     * phone: 1111
     * code: 1111
     */
    phonelogin(params) {

        return request({
            url: '/oauth/mobile',
            method: 'post',
            params: params
        })
        
    }

    /**
     * 手机号验证码登录接口
     * @param {*} params 
     * phone: 1111
     * code: 1111
     * 
     */
    login(params) {

        return request({
            url: '/oauth/mobile',
            method: 'post',
            params: params
        })
        
    }


    /**
     * 获取用户信息
     * @param {*} params 
     */
    getUserinfo(params){

        return request({
            url: 'http://39.98.161.145:8888/oauth/mobile',
            method: 'post',
            params: params
        })

    }

    /**
     * token续期
     * @param {.} params 
     */
    updatetoken(params){

        return request({
            url: 'http://39.98.161.145:8888/oauth/mobile',
            method: 'post',
            params: params
        })

    }

    logout(params) {
        return request({
            url: 'logout',
            method: 'post',
            date: params
        })
    }

}

export default new userService()